<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:core="http://www.contact.core.com/contacts/core/ui"
      xmlns:srch="http://www.contact.search.com/contacts/search/ui"
      xmlns:atria="http://www.atria.cz/common/jsf"
      xmlns:fn="http://java.sun.com/jsp/jstl/functions"
        >

<ui:component>
    <!--@elvariable id="id" type="java.lang.String>"-->
    <!--@elvariable id="value" type="java.util.List<rs.contacts.core.core.searcher.entity.FriendResult>"-->
    <style type="text/css">
        .padding0 {
            padding: 0px;
        }
    </style>
    <rich:panel id="#{id}Panel"
                style="overflow:auto;width:100%; border:none"
                bodyClass="rich-laguna-panel-no-header, padding0">


        <rich:dataTable id="#{id}ViewTable"
                        var="item"
                        value="#{value}"
                        rows="2"
                        style="width:100%"
                        styleClass="noborder">
            <rich:column filterExpression="#{fn:containsIgnoreCase(item.firstName,viewFriendSessionBean.filterFriend) || fn:containsIgnoreCase(item.lastName,viewFriendSessionBean.filterFriend)}">
                <rich:panel id="#{id}Panel"
                            style="overflow:auto;width:100%; border:none"
                            bodyClass="rich-laguna-panel-no-header">
                    <a4j:outputPanel layout="block" style="float:left;">
                        <core:pictureForViewWithName columns="2"
                                                     fullName="#{item.firstName} #{item.lastName}"
                                                     style="resize:both; width: 60px;"
                                                     pictureKey="photoprofile_#{item.id}"
                                                     informationId="#{item.id}"
                                />

                        <!--<a4j:commandLink value="#{item.firstName} #{item.lastName}"-->
                        <!--action="#{accountBean.friendProfileFromA4j}"-->
                        <!--style="font-size:13px; font-weight:200;">-->
                        <!--<f:setPropertyActionListener value="#{item}"-->
                        <!--target="#{accountBean.friendResult}"/>-->
                        <!--</a4j:commandLink>-->
                    </a4j:outputPanel>
                    <a4j:outputPanel layout="block" style="float:right; vertical-align:middle;">
                        <a4j:commandButton rendered="#{not item.commonFriend}" value="Add as Friend"
                                           action="#{newFriendBean.prepareToSendRequest}"
                                           reRender="addNewFriendRequestModalPanel"
                                           oncomplete="if(data)Richfaces.showModalPanel('addNewFriendRequestModalPanel');"
                                           limitToList="true"
                                           data="#{newFriendBean.canAdd}"
                                >
                            <f:setPropertyActionListener value="#{item}"
                                                         target="#{newFriendSessionBean.forProccess}"/>
                        </a4j:commandButton>
                    </a4j:outputPanel>
                </rich:panel>
                <!--<a4j:outputPanel layout="block" style="height:10px; width:100%">-->
                <rich:separator height="1px" width="100%"/>
                <!--</a4j:outputPanel>-->
            </rich:column>
        </rich:dataTable>
        <rich:datascroller align="center"
                           for="#{id}ViewTable"
                           style="width:100%"
                           maxPages="100"
                           limitToList="true"
                           ajaxSingle="false"
                           renderIfSinglePage="false"
                           page="#{viewFriendBean.scrollerPage}"
                           reRender="#{id}Panel"/>

    </rich:panel>


</ui:component>


</html>